Software Needed

http://files.poxlib.org/LeapFrog/RidgeRun-toolchain-369009.tar.bz2
http://files.poxlib.org/LF-Linux-8291-20101026-1425.tar.gz




Bootloader

Technically this isn't a UART boot, what will be happening is, once Emerald Boot is compiled, the Micromon application will be used to load the bin file onto the LX in RAM, where Micromon will then execute the code and start Emerald Boot loading. The reason for this is Emerald Boot is too big to load over UART since it can range from 40 to 200+KB in size, and the Pollux SoC will start running the code sent to it over UART at 16KB.




Compiling

This works with the RidgeRun toolchain and on the LF-Linux-8291-20101026-1425.tar.gz sources, it may work with others toolchains and source version, but is as of yet untested. It also requires that you have built the LF-Linux kernel, as Emerald Boot draws a few files from it.
Extract the emerald-boot-supplement archive. Make sure you have a clean copy of the emerald-boot/ directory in the LF-Source tree.

Copy screens/ to the packages/ directory in the source tree.

Copy host_tools/ to the root directory along side emerald-boot and packages. If you want you can make your own, just save them as png. Although they only get used when Emerald Boot is in USB boot mode.

Next apply the patch which makes the necessary modifications for UART booting, along with a few other mods to make things a bit more friendly. Inside the emerald-boot/ directory apply the patch.

 $ patch -p1 < /path/to/emerald-boot-supplement.patch

To compile the bootloader run

 $ OPTION=1 ./install.sh

Some OPTION values include MICRO_BOOT for UART enabling, SDCARD for booting a kernel off an SD card, and DEBUG which puts out some extra info in the console which is nice for bootloader testing.

example for UART booting and Debugging

 $ MICRO_BOOT=1 DEBUG=1 ./install.sh




UART Booting

Once you have compiled a UART enabled Emerald Boot, copy the resulting emerald-boot_UART.bin file to the micromon directory in emerald-boot-supplement/. Set the jumpers or switches to enable UART boot on the Explorer and hook up a serial cable or usb adapter, then run this command while holding down the power button.

 $ ./bootstrap.py emerald-boot_UART.bin 115200

You should see something like this

 Opening serial port
 Setting local baudrate to 19200 
 Sending block 1 of 1 block(s)
 Sending block 31 of 31 block(s)
 Setting target baudrate to 115200
 Setting local baudrate to 115200
 Remote CRC32: 0xE514244C
 Local CRC32: 0xE514244C
 Sending block 335 of 410 block(s)

This uploads a small program, Micromon to the Explorer, which allows uploading a file much larger than the 16k bytes the Pollux SoC accepts for UART booting. If all goes well the Explorer should boot up as normal.




Flash to NOR

Once you've tested out your Emerald Boot by running a UART version, or have found a precompiled NOR version you want to permanently install on your Explorer, you need to flash it to the NOR memory.
Caution: This is a potentially harmful modification. Some precautions, make sure you have a known working copy of Emerald Boot for NOR and UART. If you compile you're own, make sure to test a UART version first. Before attempting this, make sure you have fresh batteries or AC adapter, and in worst case, will be able to make the hardware modifications necessary to UART boot if you have not already.

Copy emerald-boot_NOR.bin to /LF/Bulk then run these commands on the Explorers command line.

 mfgmode.sh 9 > /dev/null
 flashcp -v /LF/Bulk/emerald-boot_NOR.bin /dev/mtd5
 mfgmode.sh 0 > /dev/null

Then reboot your device, if all went well it should boot up fine. If there is an issue and it will not boot, make the necessary hardware modifications for UART boot if you have not. UART boot the device, and redo this process with a known working version of Emerald Boot.
